Skip to content

Revert "fix: named macros with function syntax now infer previous macro resolve types (#1574)"#1694

Merged
SaltyAom merged 1 commit intomainfrom
revert-1691-fix/macro-function-inference-1574
Jan 23, 2026
Merged

Revert "fix: named macros with function syntax now infer previous macro resolve types (#1574)"#1694
SaltyAom merged 1 commit intomainfrom
revert-1691-fix/macro-function-inference-1574

Conversation

@SaltyAom
Copy link
Member

@SaltyAom SaltyAom commented Jan 23, 2026

Reverts #1691

Summary by CodeRabbit

  • Refactor
    • Simplified the macro method API with a single unified signature, replacing the previous overload-based approach for more straightforward usage.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 23, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

The macro method signature in the Elysia class is simplified from multiple type-safe overloads to a single unified signature. This reduces complexity by removing 124 lines of overload declarations and consolidating the API to accept either a string name with a Macro or an object-based Macro map. A corresponding test case is removed.

Changes

Cohort / File(s) Summary
API Simplification
src/index.ts
Removed multiple macro method overloads with complex generic parameters; consolidated into a single signature: macro(macroOrName: string | Macro, macro?: Macro) returning Elysia<...>. All overload-based type resolution logic eliminated.
Test Cleanup
test/macro/macro.test.ts
Removed test case "infer previous macro resolve in function syntax (issue #1574)" which tested type inference for nested macro resolution using function syntax. No other test logic affected.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 Overloads tangled in the weeds,
We simplify what the code needs,
One signature clean, oh what a delight,
Complexity gone—the macro shines bright!

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@SaltyAom SaltyAom merged commit 1531640 into main Jan 23, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant